package com.boot.redisson;

import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;

/**
 * @author 霜寒 <1621856595@qq.com>
 * @description 基于注解的分布式锁
 * @date 2021/9/21 0:49
 **/
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface DistributedLock {

    /**
     * 锁的名称
     */
    String value() default "";

    /**
     * 锁的有效时间，-1 启用看门狗(默认配置)
     */
    int leaseTime() default -1;

    TimeUnit unit() default TimeUnit.SECONDS;
}


